import time
from selenium import webdriver

# 打开浏览器 请求目标网址
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')

#添加登录需要的cookie
cookie = [
    {'name': 'BDUSS_BFESS',
    'value': 'G16RjhXZkhhUVFHc2c1Y01rakRpMXVTZ1pneGxmSFY5VG1vaU1OMkZMYjZiMkZpRVFBQUFBJCQAAAAAAAAAAAEAAABx5ylmSklBTkdfWlVPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPriOWL64jliO',
    },
    {'name': 'BDUSS',
     'value':'G16RjhXZkhhUVFHc2c1Y01rakRpMXVTZ1pneGxmSFY5VG1vaU1OMkZMYjZiMkZpRVFBQUFBJCQAAAAAAAAAAAEAAABx5ylmSklBTkdfWlVPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPriOWL64jliO',

    }
]
# 添加cookie
driver.add_cookie([0])
driver.add_cookie([1])

# 刷新浏览器
driver.refresh()

# 退出浏览器
time.sleep(5)
driver.quit()